<?php
class SendMailForm {
	
	const SUBJECT_REGISTERCB	= '[Like.vn] - Đăng ký tài khoản CB';
	
	public static function RegisterUserCB($username, $password, $email) {
		if (! isset ( $user->profile->email )) {
			throw new CException ( Yum::t ( 'Email is not set when trying to send Registration Email' ) );
		}
		$data['username'] =  $username;
		$data['password'] =  $password;
		$data['email'] =  $email;
		
		$body = YumTextSettings::getTextEmail('registercb', $data);
		
		if ($body){
			$mail = array ('from' => Yii::app ()->params ['noreplyEmail'], 'to' => $email, 'subject' => Yii::t ( 'default', self::SUBJECT_REGISTERCB ), 'body' => $body );
			$sent = YumMailer::send ( $mail );
		}else{
			throw new CException ( Yum::t ( 'The messages for your application language are not defined.' ) );
		}
	}
}

?>